<div class="bgc-w box box-primary">
    <!--盒子头-->
    <div class="box-header">
        <h3 class="box-title">
            <a href="addMenu" class="label label-success" style="padding: 5px;">
                <span class="glyphicon glyphicon-plus"></span> 新增
            </a>
            &nbsp; &nbsp;
            <#if mid != 0>
                <a href="/testsysmenu" class="label label-info" style="padding: 5px;">
                    <#-- <span class="glyphicon glyphicon-floppy-open"></span>--> 返回
                </a>
            <#--      <#else>
                      <a href="/testsysmenu?parent=1" class="label label-info" style="padding: 5px;">
                          &lt;#&ndash; <span class="glyphicon glyphicon-floppy-open"></span>&ndash;&gt; 子级菜单
                      </a>-->
            </#if>
        </h3>
        <#--        <input type="text" value="2${mid}" name="mid">-->
        <div class="box-tools">
            <div class="input-group" style="width: 150px;">
                <input type="text" class="form-control input-sm cha"
                       placeholder="查找..."/>
                <div class="input-group-btn chazhao">
                    <a class="btn btn-sm btn-default"><span
                                class="glyphicon glyphicon-search"></span></a>
                </div>
            </div>
        </div>
    </div>
    <!--盒子身体-->
    <div class="box-body no-padding">
        <div class="table-responsive">
            <table class="table table-hover ">
                <tr>
                    <th scope="col">菜单名称</th>
                    <th scope="col">所用图标</th>
                    <th scope="col">url</th>
                    <th scope="col">父ID</th>
                    <th scope="col">展示优先级</th>
                    <th scope="col">移动</th>
                    <th scope="col">操作</th>
                </tr>
                <#list menulist as item>
                    <tr>
                        <#-- 名称 -->
                        <td><span>
                                <a href="/testsysmenu?mid=${item.menuId}">${item.menuName}</a>
                            </span></td>
                        <#-- 图标 -->
                        <#if item.menuIcon??>
                            <td>
                                <span class="glyphicon ${item.menuIcon}"></span>
                            </td>
                        <#else>
                            <td><span>no</span></td>
                        </#if>
                        <#-- url -->
                        <td><span>${item.menuUrl}</span></td>
                        <#-- 父id -->
                        <td><span>${item.parentId}</span></td>
                        <#-- 优先级 -->
                        <td><span>${item.sortId}</span></td>

                        <#--   <#if item.roleValue??>
                            <td><span>${item.roleValue}</span></td>
                        <#else>
                            <td><span>0</span></td>
                        </#if>-->
                        <td>
                            <a href="movemenu?id=${item.menuId}&sortId=${item.sortId}&flag=up" class="label sheding">
                                <span class="glyphicon glyphicon-arrow-up"></span>上移
                            </a>
                            <a href="movemenu?id=${item.menuId}&sortId=${item.sortId}&flag=dowm" class="label sheding">
                                <span class="glyphicon glyphicon-arrow-down"></span>下移
                            </a>
                        </td>
                        <td>
                            <#-- 修改 -->
                            <a href="uppMenu?id=${item.menuId}" class="label xiugai">
                                <span class="glyphicon glyphicon-edit"></span> 修改</a>
                            <#-- 选中开启 菜单 反之 关闭 -->
                            <#if item.show == true>
                                <span class="labels">
												<label><input value="${item.menuId}" type="checkbox" name="show"
                                                              class="val"
                                                              checked><i>✓</i></label></span>
                            <#else>
                                <span class="labels">
												<label><input value="${item.menuId}" type="checkbox" name="show"
                                                              class="val"><i>✓</i></label></span>
                            </#if>
                        </td>
                    </tr>
                </#list>

            </table>
        </div>
    </div>
    <!--盒子尾-->
    <#include "/common/paging.ftl">
    <#-- 处理 返回 成功 或者失败  -->
    <#include "/common/modalTip.ftl">
</div>

<script>
    $(function () {
        $('.baseKetsubmit').on('click', function () {
            var baseKey = $('.baseKey').val();
            $('.thistable').load('${url}?baseKey=baseKey');
        });

        $(".chazhao").click(function () {
            var con = $(".cha").val();
            $(".thistable").load("menuser", {val: con});
        });

        // 点击 iso 开关 时 进行菜单 的·关闭和 开启

    });
</script>